/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ylystudio.pms.ejb.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Kenny Lin
 */
@Entity
@Table(name = "grade_item_standard")
@NamedQueries({
    @NamedQuery(name = "GradeItemStandard.findAll", query = "SELECT g FROM GradeItemStandard g"),
    @NamedQuery(name = "GradeItemStandard.findByGisId", query = "SELECT g FROM GradeItemStandard g WHERE g.gisId = :gisId"),
    @NamedQuery(name = "GradeItemStandard.findByGisPerfect", query = "SELECT g FROM GradeItemStandard g WHERE g.gisPerfect = :gisPerfect"),
    @NamedQuery(name = "GradeItemStandard.findByGisFail", query = "SELECT g FROM GradeItemStandard g WHERE g.gisFail = :gisFail"),
    @NamedQuery(name = "GradeItemStandard.findByGisPass", query = "SELECT g FROM GradeItemStandard g WHERE g.gisPass = :gisPass"),
    @NamedQuery(name = "GradeItemStandard.findByGisBad", query = "SELECT g FROM GradeItemStandard g WHERE g.gisBad = :gisBad"),
    @NamedQuery(name = "GradeItemStandard.findByGisGood", query = "SELECT g FROM GradeItemStandard g WHERE g.gisGood = :gisGood"),
    @NamedQuery(name = "GradeItemStandard.findByGisCommon", query = "SELECT g FROM GradeItemStandard g WHERE g.gisCommon = :gisCommon")})
public class GradeItemStandard implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "gis_id")
    private Integer gisId;
    @Basic(optional = false)
    @Column(name = "gis_perfect")
    private int gisPerfect;
    @Basic(optional = false)
    @Column(name = "gis_fail")
    private int gisFail;
    @Basic(optional = false)
    @Column(name = "gis_pass")
    private int gisPass;
    @Basic(optional = false)
    @Column(name = "gis_bad")
    private int gisBad;
    @Basic(optional = false)
    @Column(name = "gis_good")
    private int gisGood;
    @Basic(optional = false)
    @Column(name = "gis_common")
    private int gisCommon;
    @OneToMany(mappedBy = "gradeItemStandard", fetch = FetchType.LAZY)
    private List<GradeItem> gradeItemList;

    public GradeItemStandard() {
    }

    public GradeItemStandard(Integer gisId) {
        this.gisId = gisId;
    }

    public GradeItemStandard(Integer gisId, int gisPerfect, int gisFail, int gisPass, int gisBad, int gisGood, int gisCommon) {
        this.gisId = gisId;
        this.gisPerfect = gisPerfect;
        this.gisFail = gisFail;
        this.gisPass = gisPass;
        this.gisBad = gisBad;
        this.gisGood = gisGood;
        this.gisCommon = gisCommon;
    }

    public Integer getGisId() {
        return gisId;
    }

    public void setGisId(Integer gisId) {
        this.gisId = gisId;
    }

    public int getGisPerfect() {
        return gisPerfect;
    }

    public void setGisPerfect(int gisPerfect) {
        this.gisPerfect = gisPerfect;
    }

    public int getGisFail() {
        return gisFail;
    }

    public void setGisFail(int gisFail) {
        this.gisFail = gisFail;
    }

    public int getGisPass() {
        return gisPass;
    }

    public void setGisPass(int gisPass) {
        this.gisPass = gisPass;
    }

    public int getGisBad() {
        return gisBad;
    }

    public void setGisBad(int gisBad) {
        this.gisBad = gisBad;
    }

    public int getGisGood() {
        return gisGood;
    }

    public void setGisGood(int gisGood) {
        this.gisGood = gisGood;
    }

    public int getGisCommon() {
        return gisCommon;
    }

    public void setGisCommon(int gisCommon) {
        this.gisCommon = gisCommon;
    }

    public List<GradeItem> getGradeItemList() {
        return gradeItemList;
    }

    public void setGradeItemList(List<GradeItem> gradeItemList) {
        this.gradeItemList = gradeItemList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (gisId != null ? gisId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GradeItemStandard)) {
            return false;
        }
        GradeItemStandard other = (GradeItemStandard) object;
        if ((this.gisId == null && other.gisId != null) || (this.gisId != null && !this.gisId.equals(other.gisId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ylystudio.pms.ejb.entity.GradeItemStandard[gisId=" + gisId + "]";
    }

}
